package eirkdbd.lab1.membership.functions;

import eirkdbd.lab1.data.Team;
import eirkdbd.lab1.membership.MembershipFunction;
import eirkdbd.lab1.membership.functions.helpers.LinearMembershipFunction;


/**
 * WithGoodBalance is team ability not to have good balance between scored and lost goals
 *
 */
class NotWithGoodBalance implements MembershipFunction {
	
	private final double maxX = -40.;
	private final double minX = 20.;	
	private LinearMembershipFunction lmf;
	
	public NotWithGoodBalance() {
		lmf = new LinearMembershipFunction(minX, maxX);
	}

	/**
	 * Returns degree of membership to NotWithGoodBalance teams group
	 */
	public double getValue(Team team) {
		return lmf.value(team.getPoints());
	}

}
